package com.zzl.cwlyxt.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzl.cwlyxt.mapper.UsersMapper;
import com.zzl.cwlyxt.entity.Users;
import com.zzl.cwlyxt.service.UsersService;
import org.springframework.stereotype.Service;
import com.zzl.cwlyxt.util.Result;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * (Users)表服务实现类
 *
 * @author makejava
 * @since 2024-03-05 17:17:48
 */
@Service("usersService")
public class UsersServiceImpl extends ServiceImpl<UsersMapper, Users> implements UsersService {


    @Override
    public Result selectAll(Users users, Integer limit, Integer page) {
        List<Map<String, Object>> list = baseMapper.selectAll(users, (page - 1) * limit, limit);
        HashMap<String, Object> result = new HashMap<>();
        result.put("count", baseMapper.selectAllCount(users));
        result.put("data", list);
        return Result.success(result);
    }
}

